<template>
<view>
<!-- 筛选弹窗 -->
<view class="sx_al_box" v-if="show_sx!=0">
	<view class="mb_box" @tap="canlce_duo"></view>
	<view class="al_cont">
		<view class="al_item">
			<view class="al_tit">重量</view>
			<view class="al_lab_box">
				<view v-for="(item, index) in zl_arr" :key="index" @tap="carList1" :class="'nav_fenlei_modle ' + (car_zl==item?'nav_fenlei_modle_active':'')" data-index="6" :data-id="index+1" :data-name="item">{{item}}</view>
			</view>
		</view>
		<view class="al_item">
			<view class="al_tit">年限</view>
			<view class="al_lab_box">
				<view v-for="(item, index) in year_arr" :key="index" @tap="carList1" :class="'nav_fenlei_modle ' + (car_year==item?'nav_fenlei_modle_active':'')" data-index="3" :data-id="index+1" :data-year="item">{{item}}</view>
			</view>
		</view>
	</view>
</view>
<view class="pl_box">

	<view class="serch_view">
		<view class="serch_border_area">
			<region-picker @change="bindRegionChange" class="serch_border_area_border" :customItem="customItem" :value="region">
				<view class="picker">
					{{region[2]?region[2]:region[1]?region[1]:region[0]?region[0]:'全国'}}
				</view>
			</region-picker>
			<image class="serch_border_area_img" src="/static/pages/image/dingweixjt_btn.png"></image>
		</view>
		<view class="serch_border1">
			<image class="serch_border_img" src="/static/pages/image/sousuo_btn.png"></image>
			<view @tap="search" class="serch_border_text" placeholder placeholderStyle="font-size: 24rpx;color: #B2B2B2;" type="text">请输入搜索内容</view>
		</view>
	</view>
	<view class="serch_view" v-if="area_set==2" style="display:none;">
		<view class="serch_border">
			<image class="serch_border_img" src="/static/pages/image/sousuo_btn.png"></image>
			<view @tap="search" class="serch_border_text" placeholder placeholderStyle="font-size: 24rpx;color: #B2B2B2;" type="text">请输入搜索内容</view>
		</view>
	</view>
	<view class="clear"></view>
	<!-- 筛选菜单 -->
	<!-- <view class="scr_nav">
    <view>
      <view class="nav_item">
        <label class="nav_la">排序</label>
      </view>
      <view class="nav_item">
        <label class="nav_la">机型</label>
      </view>
      <view class="nav_item">
        <label class="nav_la">品牌</label>
      </view>
      <view class="nav_item">
        <label class="nav_la">排序</label>
      </view>
    </view>
    <!-- 选中的条件 --
    <view class="cho_box">
      <view class="">100万
        <image class="cho_img" src="../image/clone.png"></image>
      </view>
    </view>
  </view> -->
	<view style="height:80rpx;"></view>
	<view :class="'shop_view ' + (brand_show||active_index||sort_show?'shop_view_active':'')">
		<!-- <view class="new_tit">最新好车</view> -->
		<view class="nav">
			<view @tap="active_nav" :class="'nav_modle ' + (active_index==5?'nav_modle_active':'')" data-active_index="5">
			<!-- 排序 -->
				<region-picker @change="bindRegionChange" class="serch_border_area_border" :customItem="customItem" :value="region">
					<view class="picker">
						{{region[2]?region[2]:region[1]?region[1]:region[0]?region[0]:'全国'}}
					</view>
				</region-picker>
				<image class="nav_modle_img" :src="'../image/' + (active_index==5?'lvsejtxs_btn.png':'xiajiantou_btn.png')"></image>
			</view>


			<view @tap="market_brand" :class="'nav_modle ' + (active_index==2?'nav_modle_active':'')" data-active_index="2">品牌
				<image class="nav_modle_img" :src="'../image/' + (active_index==2?'lvsejtxs_btn.png':'xiajiantou_btn.png')"></image>
			</view>
			<!-- <view bindtap="car_yer" class="nav_modle {{active_index==3?'nav_modle_active':''}}" data-active_index="3">年限
        <image class="nav_modle_img" src="../image/{{active_index==3?'lvsejtxs_btn.png':'xiajiantou_btn.png'}}"></image>
      </view> -->
			<view @tap="market_class" :class="'nav_modle ' + (active_index==1?'nav_modle_active':'')" data-active_index="1">分类
				<image class="nav_modle_img" :src="'../image/' + (active_index==1?'lvsejtxs_btn.png':'xiajiantou_btn.png')"></image>
			</view>
			<view @tap="car_detail" :class="'nav_modle ' + (active_index==4?'nav_modle_active':'')" data-active_index="4">价格
				<image class="nav_modle_img" :src="'../image/' + (active_index==4?'lvsejtxs_btn.png':'xiajiantou_btn.png')"></image>
			</view>
			<view @tap="car_duo" :class="'nav_modle ' + (active_index==3?'nav_modle_active':'')" data-active_index="6">筛选
				<image class="nav_modle_img" :src="'../image/' + (active_index==3?'lvsejtxs_btn.png':'xiajiantou_btn.png')"></image>
			</view>
		</view>
		<view class="choose_view">
			<view v-for="(item, index) in search_arr" :key="index" @tap="clone" class="choose_view_modle" :data-index="index">{{item.check_name}}
				<image class="choose_view_modle_img" src="/static/pages/image/clone.png"></image>
			</view>
		</view>
		<view v-if="active_index!=0&&!brand_show">
			<view class="nav_fenlei">
				<view :class="'nav_fenlei_modle ' + (car_class!=''&&active_index==1||car_km!=''&&active_index==4||car_year!=''&&active_index==3?'':'nav_fenlei_modle_active')">不限</view>
				<view v-for="(item, index) in car_type" :key="index" @tap="carListFun" :class="'nav_fenlei_modle ' + (check_name==item.name||car_km==item||car_year==item?'nav_fenlei_modle_active':'')" :data-id="item.id" :data-index="index" :data-km="item" :data-name="item.name" :data-year="item">
					{{active_index==3?item:''}} {{active_index==4?item:''}} {{active_index!=4&&active_index!=3?item.name:''}}
				</view>
			</view>
			<view @tap="can_1" class="nav_fenlei_mengceng"></view>
		</view>

		
		<!-- <view wx:if="{{sort_show}}">
			<view class="nav_fenlei">
				<view bindtap="sort_car" class="paixu_modle  {{sort_id==index?'paixu_modle_active':''}}" data-index="{{index}}" wx:for="{{sortArr}}" wx:key="5">{{item}}
					<image class="paixu_modle_img" src="../image/duihao_icn.png" wx:if="{{sort_id==index}}"></image>
				</view>
			</view>
			<view bindtap="can_1" class="nav_fenlei_mengceng" style="background:rgba(0,0,0,0.10)"></view>
		</view> -->



		<view class="choose_area" v-if="brand_show">
			<view class="pinpai_over">
				<view v-for="(item, index) in car_type" :key="index" @tap="carListFun" class="choose_area_modle" :data-id="item.id" :data-index="index" :data-name="item.name">
					<image class="choose_area_modle_img" :src="item.brand_icon"></image>
					<view class="choose_area_modle_title">{{item.name}}</view>
				</view>
			</view>
			<view @tap="can_1" class="nav_fenlei_mengceng"></view>
		</view>
		<view class="shop_border">
			<view v-for="(item, index) in carList" :key="index" class="modle">
				<!-- <view class="tuijian">推荐</view> -->
				<!-- <image bindtap="detile" class="modle_img" mode="aspectFill" src="{{item.carimg}}"></image> -->
				<view class="timg_box" @tap="detile" :data-id="item.id">
					<image class="modle_img" mode="aspectFill" :src="item.carimg"></image>
					<image v-if="item.video!=''" class="bf_img" mode="aspectFill" :src="webUrl + 'addons/monai_market/static/wimgs/bofang.png'"></image>
				</view>
				<view @tap="detile" class="message_border" :data-id="item.id">
          <image v-if="item.status==2" class="sell_img" src="/static/pages/image/sell.png"></image>
					<view class="modle_name">
						<!-- <view class="ziying" wx:if="{{item.is_vip==1}}">认证车商</view>
                    <view class="ziying" wx:if="{{item.uid==0}}">自营</view> -->
						{{item.name}}
						<!-- {{item.year}}  {{item.exhaust}} 
          {{item.gearbox==0?'手自一体':''}}{{item.gearbox==1?'手动档':''}}{{item.gearbox==2?'自动档':''}} -->
					</view>
					<view class="modle_chexing"> {{item.year}} | {{item.province}}-{{item.city}}
						<text style="float:right" v-if="item.y>0&&item.x>0&&latitude>0&&longitude>0">{{item.distance}}km</text>
					</view>
					<view class="modle_price">
						<view class="pri_num">{{item.price}}万</view>

					</view>
					<view class="pri_butt1">
						<block v-if="item.has_invoice==0&&item.has_certificate==0"><label>无发票、合格证</label></block>
						<block v-if="item.has_invoice==1">
							<label>有发票</label>
						</block>
						<block v-if="item.has_certificate==1">
							<label>有合格证</label>
						</block>
					</view>
					<view class="pri_butt">{{item.create_time}}</view>
				</view>
			</view>

			<view class="end_none" v-if="scanReachBottom">没有更多了...</view>
			<view class="btm_nav"></view>
		</view>
	</view>
</view>
</view>
</template>

<script>
function _toConsumableArray(a) {
  if (Array.isArray(a)) {
    for (var t = 0, e = Array(a.length); t < a.length; t++) e[t] = a[t];

    return e;
  }

  return Array.from(a);
}
var app = getApp();

export default {
  data() {
    return {
      region: ["", "", ""],
      isShow: !1,
      parent_uid: 0,
      is_ok: !1,
      banner: [],
      indicatorDots: !0,
      autoplay: !0,
      interval: 5e3,
      duration: 1e3,
      textJson: [],
      textIndex: 0,
      nav_choose: ["分类", "品牌", "年限", "公里数", "排序"],
      active_index: 0,
      sortArr: ["最新发布", "价格最低", "价格最高", "里程最少", "年龄最短", "距离最近"],
      km_arr: ["0~3万", "3~5万", "5~10万", "10~15万", "15~20万", "20~30万", "30~50万", "50万以上"],
      year_arr: ["全新车", "1~3年", "3~5年", "5~9年", "10年以上"],
      zl_arr: ['10吨以下', '10~20吨', '20~30吨', '30吨以上'],
      index: 0,
      fenlei_id: 0,
      pinpai_id: 0,
      nianxian_id: 0,
      km_id: 0,
      sort_id: 0,
      car_year: "",
      car_zl: '',
      car_brand: "",
      car_km: "",
      car_class: "",
      search_arr: [],
      market: [],
      brand: [],
      check_name: "",
      carList: [],
      sort_show: !1,
      leftid: 1,
      show_new: !0,
      brand_show: !1,
      recom: 0,
      home_arr: [],
      brandname: "",
      selectbrand: "",
      brand_status: 0,
      plate_type: 1,
      scanReachBottom: !1,
      unitid: 123,
      latitude: 0,
      longitude: 0,
      customItem: "不限",
      area_set: 2,
      //筛选弹框
      show_sx: 0,
      weight_id: 0,
      car_type: [],
      webUrl: "",
      info_name: "",
      brandid: 0
    };
  },

  components: {},
  props: {},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (a) {
    var t = this;
    console.log('cid:', a);
    var loc = wx.getStorageSync('loca'); // var addr=wx.getStorageSync('addr')

    console.log(loc);
    t.setData({// region:addr
    });
    var ss, rr;

    if (a.cid) {
      if (a.otype) {
        var ty = a.otype;

        if (ty == 1) {
          var i = {
            fenlei_id: a.cid,
            car_class: a.tname,
            active_index: 1,
            mark: ss = "active_index1",
            check_name: a.tname
          };
          (rr = this.search_arr.filter(function (a) {
            return a.mark != ss;
          })).push(i), this.setData({
            car_class: a.tname,
            fenlei_id: a.cid,
            check_name: a.tname,
            search_arr: rr,
            leftid: 1
          });
        } else if (ty == 2) {
          var i = {
            km_id: a.cid,
            car_km: a.tname,
            active_index: 4,
            mark: ss = "active_index4",
            check_name: a.tname
          };
          (rr = this.search_arr.filter(function (a) {
            return a.mark != ss;
          })).push(i), this.setData({
            car_km: a.tname,
            km_id: a.cid,
            check_name: a.tname,
            search_arr: rr,
            leftid: 1
          });
        } else if (ty == 3) {
          var i = {
            nianxian_id: a.cid,
            car_year: a.tname,
            active_index: 3,
            mark: ss = "active_index3",
            check_name: a.tname
          };
          (rr = this.search_arr.filter(function (a) {
            return a.mark != ss;
          })).push(i), this.setData({
            car_year: a.tname,
            nianxian_id: a.cid,
            check_name: a.tname,
            search_arr: rr,
            leftid: 1
          });
        } else if (ty == 4) {
          var i = {
            weight_id: a.cid,
            car_zl: a.tname,
            active_index: 6,
            mark: ss = "active_index6",
            check_name: a.tname
          };
          (rr = this.search_arr.filter(function (a) {
            return a.mark != ss;
          })).push(i), this.setData({
            car_zl: a.tname,
            weight_id: a.cid,
            check_name: a.tname,
            search_arr: rr,
            leftid: 1
          });
        } else {
          console.log('选择了品牌');
          var i = {
            pinpai_id: a.cid,
            car_brand: a.tname,
            active_index: 2,
            mark: ss = "active_index2",
            check_name: a.tname
          };
          (rr = this.search_arr.filter(function (a) {
            return a.mark != ss;
          })).push(i), this.setData({
            // is_ok: !1,
            car_brand: a.tname,
            pinpai_id: a.cid,
            check_name: a.tname,
            search_arr: rr,
            leftid: 1
          });
        }
      } else {
        var i = {
          fenlei_id: a.cid,
          car_class: a.tname,
          active_index: 2,
          mark: ss = "active_index1",
          check_name: a.tname
        };
        (rr = this.search_arr.filter(function (a) {
          return a.mark != ss;
        })).push(i), this.setData({
          car_class: a.tname,
          fenlei_id: a.cid,
          check_name: a.tname,
          search_arr: rr,
          leftid: 1
        });
      }
    }

    t.noticeFun();
    app.globalData.imgUrl(), t.setData({
      webUrl: wx.getStorageSync('webUrl')
    });
    console.log('域名：', wx.getStorageSync('webUrl'));
    a && a.scene && (t.setData({
      parent_uid: a.scene
    }), app.globalData.util.getUserInfo(function (a) {
      a.memberInfo ? t.firstin(a.memberInfo) : t.setData({
        isShow: !0
      });
    }));

    if (!loc) {
      // wx.getLocation({
      //   type: "gcj02",
      //   success: function (a) {
      //     t.setData({
      //       latitude: a.latitude,
      //       longitude: a.longitude
      //     })
      //     //获取地址信息
      //     app.util.request({
      //       url: "entry/wxapp/Api",
      //       data: {
      //         m: "monai_market",
      //         r: "home.index.get_area",
      //         lat: a.latitude,
      //         lng: a.longitude,
      //       },
      //       success: function (res) {
      //         console.log('地理位置返回：', res.data);
      //         wx.setStorageSync('addr', res.data.data)
      //         t.setData({
      //           region: [res.data.data[0], res.data.data[1], res.data.data[2]]
      //         })
      //       },
      //       fail: function (res) {}
      //     }), t._list(0);
      //   },
      //   fail: function (a) {
      //     wx.openSetting({
      //       success: function (a) {
      //         a.authSetting["scope.userLocation"] ? wx.getLocation({
      //           type: "gcj02",
      //           success: function (a) {
      //             //获取地址信息
      //             app.util.request({
      //               url: "entry/wxapp/Api",
      //               data: {
      //                 m: "monai_market",
      //                 r: "home.index.get_area",
      //                 lat: lat,
      //                 lng: lon,
      //               },
      //               success: function (res) {
      //                 console.log('地理位置返回：', res.data);
      //                 t.setData({
      //                   region: [res.data.data[0], res.data.data[1], res.data.data[2]]
      //                 })
      //               },
      //               fail: function (res) {}
      //             }),
      //             t.setData({
      //               latitude: a.latitude,
      //               longitude: a.longitude
      //             }), t._list(0);
      //           }
      //         }) : (wx.showModal({
      //           content: "您未授权获取当前位置无法进行地区筛选！",
      //           showCancel: !1
      //         }), t._list(0));
      //       }
      //     });
      //   }
      // });
      t.listFun(0);
    } else {
      t.listFun(0);
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var a = this;

    if ("" != a.brandid && "" != a.brandname && 1 == a.brand_status) {
      var t = a.brandname,
          e = a.brandid,
          i = "active_index2",
          n = {
        pinpai_id: e,
        car_brand: t,
        active_index: 2,
        mark: i,
        check_name: t
      },
          s = this.search_arr.filter(function (a) {
        return a.mark != i;
      });
      s.push(n), this.setData({
        is_ok: !1,
        car_brand: t,
        pinpai_id: e,
        search_arr: s,
        leftid: 1,
        show_new: !0,
        brand_show: !1,
        brandid: 0,
        brandname: ""
      }), this.listFun(1);
    }
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    var that = this;
    that.listFun(2);
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.show_new && this.listFun(0);
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {},
  methods: {
    noticeFun: function () {
      var t = this;
      app.globalData.util.request({
        url: "entry/wxapp/Api",
        data: {
          m: "monai_market",
          r: "home.index.home1"
        },
        cachetime: "0",
        success: function (a) {
          console.log(a), a.data.data.info_name.name && wx.setNavigationBarTitle({
            title: a.data.data.info_name.name + ""
          }), 1 == a.data.data.info_name.recom && t.is_home(), 2 == a.data.data.info_name.plate_type && t.setData({
            plate_type: 2
          }), t.setData({
            banner: a.data.data.banner,
            market: a.data.data.market,
            brand: a.data.data.brand,
            textJson: a.data.data.notice,
            info_name: a.data.data.info_name.name,
            recom: a.data.data.info_name.recom
          });
        }
      });
    },
    carList1: function (a) {
      var s,
          r,
          t = app.globalData.getAttr(a, "name"),
          e = app.globalData.getAttr(a, "id"),
          index = app.globalData.getAttr(a, 'index');
      console.log(t, e);

      if (index == 6) {
        console.log(6666);
        var i = {
          weight_id: e,
          car_zl: t,
          active_index: 6,
          mark: s = "active_index6",
          check_name: t
        };
        (r = this.search_arr.filter(function (a) {
          return a.mark != s;
        })).push(i), this.setData({
          car_zl: t,
          weight_id: e,
          check_name: t,
          search_arr: r,
          leftid: 1,
          show_sx: 0
        });
      } else {
        console.log(777);
        var n = app.globalData.getAttr(a, "year");
        i = {
          nianxian_id: e = app.globalData.getAttr(a, "index"),
          car_year: n,
          active_index: 3,
          mark: s = "active_index3",
          check_name: n
        };
        (r = this.search_arr.filter(function (a) {
          return a.mark != s;
        })).push(i), this.setData({
          is_ok: !1,
          car_year: n,
          nianxian_id: 1 + parseInt(e),
          search_arr: r,
          leftid: 1,
          show_sx: 0
        });
      }

      ;
      this.listFun(1);
    },
    carListFun: function (a) {
      var t = app.globalData.getAttr(a, "name"),
          e = app.globalData.getAttr(a, "id");

      if (1 == this.active_index) {
        console.log(111);
        var i = {
          fenlei_id: e,
          car_class: t,
          active_index: 1,
          mark: s = "active_index1",
          check_name: t
        };
        (r = this.search_arr.filter(function (a) {
          return a.mark != s;
        })).push(i), this.setData({
          car_class: t,
          fenlei_id: e,
          check_name: t,
          search_arr: r,
          leftid: 1,
          show_new: !0
        });
      } else if (2 == this.active_index) {
        console.log(222);
        t = app.globalData.getAttr(a, "name"), i = {
          pinpai_id: e = app.globalData.getAttr(a, "id"),
          car_brand: t,
          active_index: 2,
          mark: s = "active_index2",
          check_name: t
        };
        (r = this.search_arr.filter(function (a) {
          return a.mark != s;
        })).push(i), this.setData({
          is_ok: !1,
          car_brand: t,
          pinpai_id: e,
          search_arr: r,
          leftid: 1,
          show_new: !0,
          brand_show: !1
        });
      } else if (3 == this.active_index) {
        console.log(333);
        var n = app.globalData.getAttr(a, "year");
        i = {
          nianxian_id: e = app.globalData.getAttr(a, "index"),
          car_year: n,
          active_index: 3,
          mark: s = "active_index3",
          check_name: n
        };
        (r = this.search_arr.filter(function (a) {
          return a.mark != s;
        })).push(i), this.setData({
          is_ok: !1,
          car_year: n,
          nianxian_id: 1 + parseInt(e),
          search_arr: r,
          leftid: 1,
          show_new: !0
        });
      } else if (4 == this.active_index) {
        console.log(444);
        var s,
            r,
            d = app.globalData.getAttr(a, "km");
        i = {
          km_id: e = app.globalData.getAttr(a, "index"),
          car_km: d,
          active_index: 4,
          mark: s = "active_index4",
          check_name: d
        };
        (r = this.search_arr.filter(function (a) {
          return a.mark != s;
        })).push(i), this.setData({
          is_ok: !1,
          car_km: d,
          km_id: 1 + parseInt(e),
          search_arr: r,
          leftid: 1,
          show_new: !0
        });
      }

      console.log(r);
      this.listFun(1);
    },
    listFun: function (a) {
      var e = this;
      console.log('重量id', this.weight_id);
      1 == a ? this.setData({
        carList: []
      }) : 2 == a && this.setData({
        carList: [],
        leftid: 1,
        show_new: !0
      }), this.setData({
        active_index: 0
      }), app.globalData.util.request({
        url: "entry/wxapp/Api",
        data: {
          m: "monai_market",
          r: "home.index.carList",
          fenlei_id: this.fenlei_id,
          weight_id: this.weight_id,
          pinpai_id: this.pinpai_id,
          nianxian_id: this.nianxian_id,
          km_id: parseInt(this.km_id),
          sort_id: this.sort_id,
          leftid: this.leftid++,
          latitude: this.latitude,
          longitude: this.longitude,
          province: this.region[0],
          city: this.region[1],
          district: this.region[2]
        },
        cachetime: "0",
        success: function (a) {
          console.log('列表信息：', a.data);
          var t;
          0 < a.data.data.length ? ((t = e.carList).push.apply(t, _toConsumableArray(a.data.data)), e.setData({
            scanReachBottom: !1
          }), e.setData({
            is_ok: !1,
            carList: e.carList
          })) : (e.setData({
            scanReachBottom: !0
          }), e.show_new = !1);
        }
      });
    },
    clone: function (a) {
      var t = app.globalData.getAttr(a, "index"),
          e = this.search_arr;
      1 == e[t].active_index ? this.setData({
        fenlei_id: 0,
        check_name: ""
      }) : 2 == e[t].active_index ? this.setData({
        pinpai_id: 0,
        car_brand: ""
      }) : 6 == e[t].active_index ? this.setData({
        weight_id: 0,
        car_zl: ""
      }) : 3 == e[t].active_index ? (this.setData({
        nianxian_id: 0,
        car_year: ""
      }), this.nianxian_id = 0) : 4 == e[t].active_index && (this.setData({
        km_id: 0,
        car_km: ""
      }), this.km_id = 0), e.splice(t, 1), this.setData({
        search_arr: e,
        active_index: 0,
        leftid: 1
      }), this.listFun(2);
    },
    market_brand: function (a) {
      wx.navigateTo({
        url: "../selectscards/index"
      });
    },
    //点击筛选
    car_duo: function () {
      var that = this;
      that.setData({
        show_sx: 1
      });
    },
    canlce_duo: function () {
      var that = this;
      that.setData({
        show_sx: 0
      });
    },
    car_detail: function (a) {
      var t = !1,
          e = app.globalData.getAttr(a, "active_index");
      this.active_index == e && (t = !(e = 0)), this.setData({
        is_ok: !0,
        car_type: this.km_arr,
        sort_show: !1,
        show_new: t,
        brand_show: !1,
        active_index: e
      });
    },
    market_class: function (a) {
      var t = app.globalData.getAttr(a, "active_index"),
          e = !1;
      this.active_index == t && (e = !(t = 0)), this.setData({
        car_type: this.market,
        brand_show: !1,
        sort_show: !1,
        active_index: t,
        show_new: e
      });
    },
    can_1: function () {
      this.setData({
        is_ok: !1,
        sort_show: !1,
        active_index: 0,
        show_new: !0,
        brand_show: !1
      });
    },
    bindRegionChange: function (a) {
      var t = "不限" == a.detail.value[0] ? "" : a.detail.value[0],
          e = "不限" == a.detail.value[1] ? "" : a.detail.value[1],
          i = "不限" == a.detail.value[2] ? "" : a.detail.value[2];
      this.setData({
        region: [t, e, i]
      }), this.listFun(2);
    },
    sort_car: function (a) {
      var t = app.globalData.getAttr(a, "index");
      if (this.setData({
        sort_show: !1,
        is_ok: !1
      }), 5 == t) return this._distanceSort(t), !1;
      this.setData({
        sort_id: t
      }), this.listFun(2);
    },
    active_nav: function (a) {
      var t = app.globalData.getAttr(a, "active_index");
      this.active_index != t ? this.setData({
        sort_show: !0,
        show_new: !1,
        active_index: t,
        brand_show: !1
      }) : this.setData({
        sort_show: !1,
        active_index: 0,
        show_new: !1
      });
    },
    car_yer: function (a) {
      var t = app.globalData.getAttr(a, "active_index");
      this.active_index == t && (t = 0), this.setData({
        sort_show: !1,
        car_type: this.year_arr,
        active_index: t,
        show_new: !1,
        brand_show: !1
      });
    },
    detile: function (a) {
      var t = app.globalData.getAttr(a, "id");
      wx.navigateTo({
        url: "/pagesA/home/carMessage/carMessage?id=" + t
      });
    },
    search: function () {
      wx.navigateTo({
        url: "/pagesA/home/searchShop/searchShop"
      });
    }
  }
};
</script>
<style>
@import "./productList.css";
</style>